home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 2
/
Merciful - Disc 2.iso
/
software
/
p
/
pc2amiv3.2.lha
/
PC2AmiV3.2
/
ConfigPC2Amiga
next >
Wrap
Text File
|
1994-03-15
|
8KB
|
249 lines
; Configuration script for the PC2Am program
;Indicator types
(set ISTR0 "None")
(set ISTR1 "LED")
(set ISTR2 "Gopher-like")
(set ISTR3 "Background")
;(set ISTR4 "Mouse")
;Speeds
(set SPEED0 "1200")
(set SPEED1 "2400")
(set SPEED2 "4800")
(set SPEED3 "9600")
(set SPEED4 "19200")
(set SPEED5 "38400")
(set SPEED6 "57600")
(set SPEED7 "115200")
(procedure EditConfig
; Set device
(set DefDev ("DEVS:/%s" Device))
(set Device
(fileonly
(askfile
(prompt "Select device you want to use. Click on HELP for further details")
(help
"You have to select device to communicate via. It will mostly be \"serial.device\" "
"but you can also use \"artser.device\" etc. But remember that some devices don't "
"support the Break() function (baudbandit.device), so they cannot be used."
)
(default DefDev)
)
)
)
; Set unit
(set Unit
(asknumber
(prompt "Select unit of the device")
(help "This will be mostly zero. You will have to change it only if you use a multiserial card.")
(default Unit)
)
)
; Set Flags
(set Flags
(asknumber
(prompt "Select open flags of the device")
(help "This will be mostly zero. You will have to change it only if you use a multiserial card.")
(range -2147483648 2147483647)
(default Flags)
)
)
; Set baud rate
; Find baud code
(set BaudCode 0)
(while (AND (> BaudRate (+ 0 (select BaudCode SPEED0 SPEED1 SPEED2 SPEED3 SPEED4 SPEED5 SPEED6 SPEED7))) (< BaudCode 7))
(set BaudCode (+ BaudCode 1))
)
(set BaudRate
(+ 0
(select
(askchoice
(prompt "Select baud rate")
(choices SPEED0 SPEED1 SPEED2 SPEED3 SPEED4 SPEED5 SPEED6 SPEED7)
(default BaudCode)
(help
"You have to select baud rate to communicate on. It is important to set "
"this baudrate to the same value on both Amiga and PC. Selecting too big "
"baudrate may cause infunctionality, low baudrates lowers transfer speed. "
"If you have at least A500 and 386SX/40, you can choose 57600."
)
)
SPEED0 SPEED1 SPEED2 SPEED3 SPEED4 SPEED5 SPEED6 SPEED7
)
)
)
;Set MaxTransfer
(set MaxTransfer
(asknumber
(prompt "Set maximal length of a packet.")
(range 128 8192)
(help
"Here you can set the maximal length of packet, that is transfered via "
"serial (parallel) line. Note that it is used only for sending files, "
"because other packets (open, ...) are only about 20 bytes long. So set "
"it to a lower value only when you can list directories well (listing main "
"PC: directory takes shorter packets that listing "true" directory on PC). "
"Usually, you can keep this value at least 4096 or even 8192."
)
(default MaxTransfer)
)
)
;Set timeout
(set Timeout
(asknumber
(prompt "Set timeout\nNote, that it is in TENTHS of second.")
(help
"Timeout is the time, after which Amiga will try to restore "
"send PC a break, to make it reply packet etc. Good value is about"
"20 (2 secs) or a little bit more. High values do not have sense, "
"because there will be spent much time in waiting for PC. But setting "
"it too small may cause many timeouts when working with slower device "
"(floppy) or on small baud rates."
)
(default Timeout)
)
)
;Set progress indicator
(set IndicType
(askchoice
(prompt "Select progress indicator type")
(choices ISTR0 ISTR1 ISTR2 ISTR3)
(default IndicType)
(help
"Progress indicator is something that tells you the communication is "
"still working (data are transfering). Here's a description of supported "
"types:\n\n"
"NONE - No indicator will be used\n\n"
"LED - Power LED brightness will be turned after sending each packet. "
"So when communication works, you will see LED flashing. But it may confuse "
"you, because it looks like you have been visited by a guru (system crash)."
"It may also interfere with a music playing program, because turning LED "
"turns also ON/OFF audio filter.\n\n"
"GOPHER-LIKE - In the PC2Amiga commodity window, there's a square, in which "
"you will see rotating line. But you have to popup PC2Amiga to see it, so you "
"cannot look at it all the time.\n\n"
"BACKGROUND - After sending every packet, background flashes. Maybe good for "
"some people, but for me it is too \"hard\" indication.\n\n"
; "MOUSE - Mouse will flash as when unpacking by PowerPacker."
)
)
)
; Set long filenames
; (set UseLongNames
; (askchoice
; (prompt "Do you want to use long filenames (not cut it to 8.3)?")
; (choices "No" "Yes")
; (help
; "MS-DOS had limited filenames to eight chars, then must be a dot, and then "
; "you can use another three chars. But Windows 95 and also OS/2 does not have "
; "this limitations, so you can use longer filenames. (Although I don't know if "
; "PC2Amiga works under OS/2.\n\n"
; "If you turn on using long names, the filenames will not be cut to 8.3 chars, "
; "and will remain as they were on Amiga. But when you will be using PC2Amiga "
; "under DOS, you will not be able to open any file with long filename, so "
; "don't turn this on if you don't know what you are doing."
; )
; (default UseLongNames)
; )
; )
)
(if (<= (getversion (resident)) (* 37 65536))
(abort "Sorry, this script works only for systems 2.1 and later (kickstart version 37+)")
)
(if (= (exists "c:GetPCSpecs") 0)
(abort "Cannot find command 'c:GetPCSpecs'. If you haven't installed PC2Amiga yet, you must do it before running this configuration script.")
)
(if (= (exists "c:SetPCSpecs") 0)
(abort "Cannot find command 'c:SetPCSpecs'. If you haven't installed PC2Amiga yet, you must do it before running this configuration script.")
)
(user 2)
(set FileName
(askfile
(prompt "Please enter where you have installed the device specification file (\"PC\").")
(help
"There's a device specification file (called \"PC\"), which also contains "
"configuration data. Configuration script needs to know where it is to change "
"it. It should be either in the SYS:Storage/DOSDrivers or DEVS:DOSDrivers directory."
)
(default "SYS:Storage/DOSDrivers/PC")
)
)
(if (= (exists FileName) 0)
(abort "The file you have entered does not exist !")
)
(run ("GetPCSpecs %s" FileName))
; Get original values
(set Device (getenv "P2A_DEVICE"))
(set Unit (+ 0 (getenv "P2A_UNIT")))
(set Flags (+ 0 (getenv "P2A_FLAGS")))
(set BaudRate (+ 0 (getenv "P2A_BAUD")))
(set MaxTransfer (+ 0 (getenv "P2A_MAXTRANSFER")))
(set Timeout (+ 0 (getenv "P2A_TIMEOUT")))
(set HFlags (+ 0 (getenv "P2A_BLOCKSPERTRACK")))
(set IndicType (BITAND HFlags 7))
(set UseLongNames (= (BITAND HFlags 8) 1))
(until
(= Result 1)
(EditConfig)
; Set some vars
(set TSecs (/ Timeout 10))
(set TTent (- Timeout (* TSecs 10)))
(set Result
(askbool
(prompt
"Confirm settings:"
("Device: %s\nUnit: %ld\nFlags: %ld\nBaudRate: %ld\nTimeout: %ld.%lds\n" Device Unit Flags BaudRate TSecs TTent)
("Indicator: %s\n" (select IndicType ISTR0 ISTR1 ISTR2 ISTR3))
("Use long filenames: %s\n" (select UseLongNames "No" "Yes"))
)
(help "Script asks you to confirm your selection.")
)
)
)
; Copy values to env vars
(set HFlags (+ IndicType (* UseLongNames 8)))
(textfile (dest "ENV:P2A_DEVICE") (append Device))
(textfile (dest "ENV:P2A_UNIT") (append Unit))
(textfile (dest "ENV:P2A_FLAGS") (append Flags))
(textfile (dest "ENV:P2A_BAUD") (append BaudRate))
(textfile (dest "ENV:P2A_MAXTRANSFER") (append MaxTransfer))
(textfile (dest "ENV:P2A_TIMEOUT") (append Timeout))
(textfile (dest "ENV:P2A_BLOCKSPERTRACK") (append HFlags))
(run ("SetPCSpecs %s T:PC" FileName))
(copyfiles
(source "t:PC")
(dest (pathonly FileName))
)
(exit "\n\nDON'T FORGET TO SETUP ALSO THE PC PART\n(USING THE \"PC2AMCFG.EXE\" PROGRAM)")
(welcome)